package com.demo.dao;

/**
 * @desc:
 * @author: Ping
 * @date: 2024/9/28 15:38
 */

import com.demo.model.auth.User;

/**
 *
 *  DAO: data access object
 *
 */
public interface UserDao {
    /**
     * insert user into the table
     * @param user
     * @return 1 for insert successfully.
     *       ow. 0  for failed.
     */
    public Integer insert(User user) ;

    /**
     * update user by user parameters.
     * @param user:  parameter
     */
    public void update(User user) ;

    /**
     * select user by username and password for login.
     * @param username
     * @param password
     * @return
     */
    public User select(String username, String password) ;

    /**
     * delete user by id
     * @param userId
     * @return
     */
    public Integer delete(int userId) ;




}
